import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';

typedef ClickCallBack = void Function(int selectIndex, String selectText);

class PopMenus {
  static void showPop(
      {@required BuildContext context,
        // @required List<String> listData,
        @required String selText,
        ClickCallBack clickCallback}) {
        Widget _buildMenuLineCell() {
          return  Container(
                // color: Colors.white,
                width: ScreenUtil().setWidth(151),
                height:ScreenUtil().setWidth(92),
                child: Text(selText,style:TextStyle(fontSize: ScreenUtil().setSp(13),color: Color(0xffF04106))),
              );
      
    }
    showDialog(
        context: context,
        barrierDismissible: false,
        builder: (context) {
          return BasePopMenus(child: _buildMenuLineCell());
        });
  }
}

class BasePopMenus extends Dialog {
  BasePopMenus({
    Key key,
    this.child,
  }) : super(key: key);

  final Widget child;

  @override
  Widget build(BuildContext context) {
    return Material(
      type: MaterialType.transparency,
      child: Stack(
        // fit: StackFit.expand,
        children: <Widget>[
          Container(
            width: ScreenUtil.screenWidth,
            height:ScreenUtil().setWidth(92),
          ),
          GestureDetector(onTap: () => Navigator.pop(context)),
          Positioned(
              left:ScreenUtil().setWidth(62),
              top:ScreenUtil().setWidth(364),
              child: Container(
                width: ScreenUtil().setWidth(151),
                height:ScreenUtil().setWidth(92),
                child: Image.asset("sources/yy/redkung.png"),
              )
          ),
          Positioned(
              left:ScreenUtil().setWidth(66),
              top:ScreenUtil().setWidth(370),
              child:child
          ),

        ],
      ),
    );
  }
}
